<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #box {
      width: 600px;
      height: 400px;
    }
  </style>
</head>

<body>
  <div id="box"></div>
</body>

</html>
<script src="../node_modules/echarts/dist/echarts.min.js"></script>
<script>
  let charts = echarts.init(document.getElementById('box'));


  let option = {
    title: {
      text: 'hello'
    },
    tooltip: {},
    visualMap: {
      show: true,
      inRange: {
        color: ['green', 'yellow']
      },
      type: 'piecewise', // 定义为分段型 visualMap
      pieces: [{
          min: 50,
          max: 120
        },
        {

          min: 130,
          max: 160,
        },
        {

          min: 200,
          max: 240,
        }, {

          min: 290,
          max: 330
        }
      ]
    },

    series: [{
      name: '姓名',
      type: 'pie',
      radius: '50%',
      center: ['30%', '50%'],
      roseType: 'radius',
      data: [{
          name: "A",
          value: 101
        },
        {
          name: "B",
          value: 230
        },
        {
          name: "AC",
          value: 300
        },
        {
          name: "AD",
          value: 151
        }
      ]
    }]
  }

  charts.setOption(option);
</script>